package com.example.shuiyin.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import org.springframework.validation.annotation.Validated;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;

@Data
@Configuration
@ConfigurationProperties(prefix = "jwt")
@Validated
public class JwtProperties {
    
    @NotBlank(message = "JWT密钥不能为空")
    private String secret = "shuiyinappsecretkey12345678901234567890";
    
    @NotNull(message = "JWT过期时间不能为空")
    private Long expiration = 86400000L; // 默认1天
    
    @NotNull(message = "JWT刷新过期时间不能为空")
    private Long refreshExpiration = 604800000L; // 默认7天
} 